package cc.ailley.prototype.depth;

import cc.ailley.prototype.shallow.ShallowCloneResume;

import java.util.ArrayList;

public class DepthCloneResumeTest {

    public static void main(String[] args) throws CloneNotSupportedException {
        ArrayList<String> familyMember = new ArrayList<>(); // 家庭成员名单
        familyMember.add("father");
        familyMember.add("mather");

        // 创建初始简历
        DepthCloneResume resume1 = new DepthCloneResume("Jobs", familyMember);
        resume1.setPersonal("Male", 26);
        resume1.setWork("2014/8/1 - 2016/6/30", "HuaWei");

        // 通过简历1复制出简历2，并对家庭成员和工作经验进行修改
        DepthCloneResume resume2 = resume1.clone();
        resume2.setName("Tom");
        resume2.familyMember.add("Brother");
        resume2.setWork("2016/7/1 - 2018/6/30", "BaiDu");

        resume1.display();
        resume2.display();
    }
}
